import request from '@/router/axios'

export function appBannerList(query) {
	return request({
		url: '/pms-api/pms/app/banner/page',
		method: 'get',
		params: query
	})
}

export function htmlBannerList(query) {
	return request({
		url: '/pms-api/pms/html/banner/page',
		method: 'get',
		params: query
	})
}

export function storeBannerList(query) {
	return request({
		url: '/pms-api/pms/store/banner/operate/get/page',
		method: 'get',
		params: query
	})
}

export function appAddBanner(query) {
	return request({
		url: '/pms-api/pms/app/banner',
		method: 'post',
		data: query
	})
}

export function appUpdateBanner(query) {
	return request({
		url: '/pms-api/pms/app/banner',
		method: 'put',
		data: query
	})
}

export function htmlAddBanner(query) {
	return request({
		url: '/pms-api/pms/html/banner',
		method: 'post',
		data: query
	})
}

export function htmlUpdateBanner(query) {
	return request({
		url: '/pms-api/pms/html/banner',
		method: 'put',
		data: query
	})
}

export function appDeleteBanner(id) {
	return request({
		url: '/pms-api/pms/app/banner/' + id,
		method: 'delete',
	})
}

export function htmlDeleteBanner(id) {
	return request({
		url: '/pms-api/pms/html/banner/' + id,
		method: 'delete',
	})
}

// -----首页标签-------//

// 查询店铺标签
export function operatePage(data) {
	return request({
		url: '/pms-api/pms/label/operate/page',
		method: 'get',
		params: data
	})
}

export function appPage(data) {
	return request({
		url: '/pms-api/pms/label/app/page',
		method: 'get',
		params: data
	})
}

export function delLabel(id) {
	return request({
		url: '/pms-api/pms/label/app/' + id,
		method: 'delete',
	})
}

export function addLabel(data) {
	return request({
		url: '/pms-api/pms/label/app',
		method: 'post',
		data: data
	})
}

export function updateLabel(data) {
	return request({
		url: '/pms-api/pms/label/app',
		method: 'put',
		data: data
	})
}

// 配置商品
export function operateDelLabelList(data) {
	return request({
		url: '/pms-api/pms/operate/label/dtl/page',
		method: 'get',
		params: data
	})
}

export function operateDelLabel(id) {
	return request({
		url: '/pms-api/pms/operate/label/dtl/' + id,
		method: 'delete',
	})
}

export function operateSortDelLabel(data) {
	return request({
		url: '/pms-api/pms/operate/label/dtl',
		method: 'put',
		data: data
	})
}

export function operateAddDelLabel(data) {
	return request({
		url: '/pms-api/pms/operate/label/dtl',
		method: 'post',
		data: data
	})
}

// 活动专区
export function activityList(data) {
	return request({
		url: '/pms-api/pms/activity/page',
		method: 'get',
		params: data
	})
}

export function activityAdd(data) {
	return request({
		url: '/pms-api/pms/activity',
		method: 'post',
		data: data
	})
}

export function activityUpdate(data) {
	return request({
		url: '/pms-api/pms/activity',
		method: 'put',
		data: data
	})
}

export function activityDelete(id) {
	return request({
		url: '/pms-api/pms/label/' + id,
		method: 'delete',
	})
}

// ----- 热卖 ----------
export function platformSeleList(data) {
	return request({
		url: '/pms-api/pms/hot/sale/platform/product',
		method: 'get',
		params: data
	})
}

export function storeSeleList(data) {
	return request({
		url: '/pms-api/pms/hot/sale/store/product',
		method: 'get',
		params: data
	})
}

export function seleDelete(id) {
	return request({
		url: '/pms-api/pms/hot/sale/' + id,
		method: 'delete',
	})
}

// 通过店铺或平台id查询以选中的热卖商品
export function getSaleProduct(data) {
	return request({
		url: '/pms-api/pms/hot/sale/get/product',
		method: 'get',
		params: data
	})
}

// 根据店铺id或平台id查询没有添加的商品
export function platformSeleProduct(data) {
	return request({
		url: '/pms-api/pms/hot/sale/noAddedProduct',
		method: 'get',
		params: data
	})
}

export function hotSaleUpdate(data) {
	return request({
		url: '/pms-api/pms/hot/sale',
		method: 'put',
		data: data
	})
}

export function hotSaleAdd(data) {
	return request({
		url: '/pms-api/pms/hot/sale',
		method: 'post',
		data: data
	})
}

export function getProduct(data) {
	return request({
		url: '/pms-api/pms/operate/label/dtl/get/product',
		method: 'get',
		params: data
	})
}

// 配置商品单个删除
export function eraseSingleProduct(data) {
	return request({
		url: '/pms-api/pms/hot/sale/eraseSingleProduct',
		method: 'post',
		data: data
	})
}